package com.sita.linboard.base;

import android.app.Activity;
import android.graphics.LightingColorFilter;

import com.sita.linboard.utils.LogUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Jason on 2016/8/25.
 */
public class ActivityCollector {
    private static int i=0;
    public static List<Activity> activities = new ArrayList<>();
    public static void addActivity(Activity activity){
        activities.add(activity);
    }
    public static void removeActivity(Activity activity){
        activities.remove(activity);
    }
    public static void finishAll(){
        for (Activity activity:activities){
            if (!activity.isFinishing()){
                activity.finish();
            }

        }
    }
    public static void finishRemindActivity(Activity activitys){
        for (Activity activity: activities){
            if (activity.getComponentName().getClassName().equals(activitys.getComponentName().getClassName())){
                activity.finish();
            }
        }
    }
}
